<template>
    <view class="container">
      <web-view :src="webviewUrl"></web-view>
    </view>
  </template>
  
  <script>
  export default {
    data() {
      return {
        webviewUrl: ''
      };
    },
    onLoad(options) {
      // if (options.url) {
      //   this.webviewUrl = decodeURIComponent(options.url);
      // } else {
      //   uni.showToast({ title: '无效链接', icon: 'none' });
      // }
      this.getCustomerServiceUrl();
    },
    onShow(){
		this.getCustomerServiceUrl();
	  },
    onBackPress() {
        uni.switchTab({
        url: "/pages/home/home"
        });
        return true;
    },
    methods:{
        getCustomerServiceUrl() {
        var that = this;
        uni.$uv.http.get('/setting/getCustomerServiceUrl').then(res => {
          that.webviewUrl = res.data;
        });
      },
    }
  };
  </script>
  
  <style scoped>
  .container {
    width: 100%;
    height: 100%;
    padding-bottom: 50px;
  }
  </style>